package com.blog.wu.myblog.rabbitmq;

import com.blog.wu.myblog.base.BaseService;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author wuyanshen
 * @Date 2018-12-27 9:27 AM
 * @Discription RabbitMq生产者
 */
//@Component
public class RabbitMqProducer extends BaseService {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendMessage(String msg) {
        logger.info("我是生产者，我生产消息："+msg);
        amqpTemplate.convertAndSend("我是生产者："+msg);
    }
}
